package com.itheima.web.manager;

import com.itheima.service.db.ManageService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class ManageManager {

    @DubboReference
    private ManageService manageService;

    // 动态通过
    public Map pass(String[] ids) {
        manageService.pass(ids);
        // 返回
        Map<String, String> map = new HashMap<>();
        map.put("message", "操作成功");
        return map;
    }

    // 动态拒绝
    public Map reject(String[] ids) {
        manageService.reject(ids);
        // 返回
        Map<String, String> map = new HashMap<>();
        map.put("message", "操作成功");
        return map;
    }
}
